home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-06-25 | 3.5 KB | 149 lines | [TEXT/CWIE] |
- //
- // File: LifeModule.h
- // Contains: Interface definitions for life plug in modules
- // Written by: Douglas Clarke
- // Copyright: @ 1992-1997 by Apple Computer, Inc., all rights reserved.
- // <1> 04/25/97 DGC First check in
- //
-
- ////////////////////////////////////////////////////////////////////////
- //
- // PICreateLife
- //
- // This routine creates the life data structure
- //
- // Inputs:
- // ThePrivateData A zero length handle place holder
- // sizeX the number of cells across (1 based)
- // sizeY the number of cells up and down (1 based)
- // cellSizeX the number of pixels wide a cell pict is
- // cellSizeY the number of pixels tall a cell pict is
- // theWindow a window large enough to hold the cells drawn as Pict
- // alivePict True to measure while PM is set
- //
- // Outputs:
- // error code if any
-
-
- OSErr PICreateLife(Handle ThePrivateData,
- unsigned long *life_base,
- short rowbytes,
- long color);
-
- ////////////////////////////////////////////////////////////////////////
- //
- // PITrashLife
- //
- // This routine cleans up the life game data.
- // all handles and pointers alocated by the plugin must be deisposed of
- // the size of ThePrivateData is to be set back to zero and unlocked
- //
- // Inputs:
- // ThePrivateData the life plugins data
- //
- // Outputs:
- // error code if any
-
- OSErr PITrashLife(Handle ThePrivateData);
-
- ////////////////////////////////////////////////////////////////////////
- //
- // PISetACell
- //
- // This routine cleans up the life game data.
- // all handles and pointers alocated by the plugin must be deisposed of
- // the size of ThePrivateData is to be set back to zero and unlocked
- //
- // Inputs:
- // ThePrivateData the life plugins data
- // x zero based right offset to cell
- // y zero based down offset to cell
- // state true = alive
- //
- // Outputs:
- // error code if any
-
- OSErr PISetACell(Handle ThePrivateData,long x, long y, Boolean state);
-
- ////////////////////////////////////////////////////////////////////////
- //
- // PIDrawACell
- //
- // This routine draws one cell to the window.
- // an alive cell is drawn with a pict
- // a dead cell is erased
- //
- // Inputs:
- // ThePrivateData the life plugins data
- // x zero based right offset to cell
- // y zero based down offset to cell
- //
- // Outputs:
- // error code if any
-
- OSErr PIDrawACell(Handle ThePrivateData,long x, long y);
-
- ////////////////////////////////////////////////////////////////////////
- //
- // PIReadACell
- //
- // This routine returns the state of one cell
- //
- // Inputs:
- // ThePrivateData the life plugins data
- // x zero based right offset to cell
- // y zero based down offset to cell
- //
- // Outputs:
- // true of cell is alive
-
- Boolean PIReadACell(Handle ThePrivateData,long x, long y);
-
- ////////////////////////////////////////////////////////////////////////
- //
- // PINextGeneration
- //
- // This routine runs through each cell and adjusts its state
- //
- // Inputs:
- // ThePrivateData the life plugins data
- //
- // Outputs:
- // error code if any
-
- OSErr PINextGeneration(Handle ThePrivateData);
-
- ////////////////////////////////////////////////////////////////////////
- //
- // PIDrawBoard
- //
- // This routine runs through each cell and draws it
- //
- // Inputs:
- // ThePrivateData the life plugins data
- //
- // Outputs:
- // error code if any
-
- OSErr PIDrawBoard(Handle ThePrivateData);
-
-
- ////////////////////////////////////////////////////////////////////////
- //
- // PISetColor
- //
- // This routine tells the module what color to draw the cells
- //
- // Inputs:
- // RGBColor aColor
- //
- // Outputs:
- // void
-
- void PISetColor(Handle ThePrivateData, long color);
-
-
-
-
-
-